﻿<?php
header("content-type:text/html; charset:utf8");
include('../share.class.php');
session_start();
$user_mail = $_SESSION['login_mail'];
$bbs = new bbs($user_mail);
if(isset($_POST['type']) && $_POST['type'] == 'insert'){ $bbs->handContent($_POST['message']); }
if(isset($_POST['type']) && $_POST['type'] == 'delete'){ $bbs->deleteContent($_POST['bbs_id']); }
if(isset($_POST['type']) && $_POST['type'] == 'vote')
{ 
	$bbs_id = $_POST['bbs_id'];
	$sql_vote = "update food_bbs set vote = vote + 1 where id = '$bbs_id'";
	mysql_query($sql_vote);
	$query_vote = mysql_query("select * from food_bbs where id = '$bbs_id'");
	$row_vote = mysql_fetch_assoc($query_vote);
	echo $row_vote['vote']."人觉得很赞";
}

?>
